<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
    <head>
        <th:block th:include="include :: header('编辑标签')"/>
    </head>
    <body class="white-bg">
        <div class="wrapper wrapper-content animated fadeInRight ibox-content">
            <form class="form-horizontal m" id="form-Tag-edit" th:object="${tag}">
                <input type="hidden" th:field="*{pkid}">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">请输入标签名称：</label>
                    <div class="col-sm-8">
                        <input type="text" placeholder="请输入标签名......" th:field="*{tagName}" class="form-control" name="tagName" id="tag_name"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">是否设为常用标签：</label>
                    <div class="col-sm-8">
                        <label class="check-box">
                            <input name="isCommon" value="1" type="radio" th:field="*{isCommon}">是
                        </label>
                        <label class="check-box">
                            <input name="isCommon" value="0" type="radio" th:field="*{isCommon}" checked>否
                        </label>
                    </div>

                </div>
                <div class="col-sm-offset-3">
                    <a class="help-block m-b-none" style="color: red;margin-left: 10px;">
                        <i class="fa fa-info-circle"></i>
                           填写说明：<br>
                                  a、此处新增由上级部门完成，请不要擅自增加；<br>
                                  b、“常用标签”：一但录入，不建议进行修改；<br>
                    </a>
                </div>
            </form>
        </div>
        <th:block th:include="include :: footer"/>
        <th:block th:include="include :: bootstrap-typeahead-js" />
        <script>
            var prefix = ctx + "system/tag";

            //双击选择

            $("#form-category-add").validate({});

            function submitHandler() {
                if ($.validate.form()) {
                    $.operate.save(prefix + "/editTag", $('#form-Tag-edit').serialize());
                }
            }
            function doSubmit(index) {
                layer.close(index);
            }

            $.get(prefix + "/autoComplete", function(data){
                $("#tag_name").typeahead({
                    source: data.value
                });
            },'json');

        </script>
    </body>
</html>
